const cloud = require('wx-server-sdk')
cloud.init({
  env:"agriculture-4g9roniha194f9d1"
})
const db = cloud.database()
const _ = db.command
exports.main = async (event, context) => {
  var openid = event.openid;
  var object_id = event.object_id;
  try {
    return await db.collection('collection').where({
      _openid:openid,
      'object._id':_.in(object_id)
    }).remove()
  } catch(e) {
    console.error(e)
  }
}